<ion-navbar *navbar primary>
    <ion-title>
        通知
    </ion-title>
    <ion-buttons end>
        <button (click)="readAll()">
            <ion-icon name="done-all"></ion-icon>
        </button>
        <button (click)="refresh()">
            <ion-icon name="refresh"></ion-icon>
        </button>
    </ion-buttons>
</ion-navbar>

<ion-content class="notify">
    <!--<ion-refresher (refresh)="doRefresh($event)">-->
        <!--<ion-refresher-content></ion-refresher-content>-->
    <!--</ion-refresher>-->
    <ion-list>
        <ion-spinner *ngIf="!notifications"></ion-spinner>
        <ion-item *ngIf="notifications&&notifications.length==0">暂无任何通知消息</ion-item>
        <ion-list-header *ngIf="notifications&&notifications.length>=1">开播通知</ion-list-header>
        <ion-item-sliding *ngFor="#notification of notifications">
            <ion-item>
                <ion-thumbnail item-left>
                    <img [src]="notification.avatar">
                </ion-thumbnail>
                <h2>{{notification.nickname}}</h2>
                <p>{{notification.content}}</p>
                <p>Start at {{notification.notified_at | amTimeAgo}}</p>
            </ion-item>
            <ion-item-options>
                <button primary (click)="watchDirect(notification)">
                    <ion-icon light name="play"></ion-icon>
                    观看
                </button>
                <button secondary (click)="shareOut(notification)">
                    <ion-icon light name="share"></ion-icon>
                    分享
                </button>
                <button danger (click)="removeNotification(notification)">
                    <ion-icon light name="close"></ion-icon>
                    删除
                </button>
            </ion-item-options>
        </ion-item-sliding>
    </ion-list>
</ion-content>
